<?php

use Biz\service\trade\UserAddress as sAddressUser;

class SetDefaultAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_REGISTER;

    public function main()
    {
        $data = [
            'address_id' => (int)$this->getRequest()->getPost('id'),
            'uid' => $this->uid,
            'is_default' => (int)$this->getRequest()->getPost('is_default', 0)
        ];
        $result = sAddressUser::saveDefaultAddress($data);
        $this->setSuccess($result);

    }
}